package com.ruoyi.project.express.accounts.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.express.accounts.mapper.ExpressAccountsMapper;
import com.ruoyi.project.express.accounts.domain.ExpressAccounts;
import com.ruoyi.project.express.accounts.service.IExpressAccountsService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 物流账号Service业务层处理
 * 
 * @author lindor
 * @date 2020-04-07
 */
@Service
public class ExpressAccountsServiceImpl implements IExpressAccountsService 
{
    @Autowired
    private ExpressAccountsMapper expressAccountsMapper;

    /**
     * 查询物流账号
     * 
     * @param partnerId 物流账号ID
     * @return 物流账号
     */
    @Override
    public ExpressAccounts selectExpressAccountsById(Long partnerId)
    {
        return expressAccountsMapper.selectExpressAccountsById(partnerId);
    }

    /**
     * 查询物流账号列表
     * 
     * @param expressAccounts 物流账号
     * @return 物流账号
     */
    @Override
    public List<ExpressAccounts> selectExpressAccountsList(ExpressAccounts expressAccounts)
    {
        return expressAccountsMapper.selectExpressAccountsList(expressAccounts);
    }

    /**
     * 新增物流账号
     * 
     * @param expressAccounts 物流账号
     * @return 结果
     */
    @Override
    public int insertExpressAccounts(ExpressAccounts expressAccounts)
    {
        expressAccounts.setCreateTime(DateUtils.getNowDate());
        return expressAccountsMapper.insertExpressAccounts(expressAccounts);
    }

    /**
     * 修改物流账号
     * 
     * @param expressAccounts 物流账号
     * @return 结果
     */
    @Override
    public int updateExpressAccounts(ExpressAccounts expressAccounts)
    {
        expressAccounts.setUpdateTime(DateUtils.getNowDate());
        return expressAccountsMapper.updateExpressAccounts(expressAccounts);
    }

    /**
     * 删除物流账号对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteExpressAccountsByIds(String ids)
    {
        return expressAccountsMapper.deleteExpressAccountsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除物流账号信息
     * 
     * @param partnerId 物流账号ID
     * @return 结果
     */
    @Override
    public int deleteExpressAccountsById(Long partnerId)
    {
        return expressAccountsMapper.deleteExpressAccountsById(partnerId);
    }
}
